<?php
// +----------------------------------------------------------------------
// | quanli team
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2020 http://www.fistforward.com/ All rights reserved.
// +----------------------------------------------------------------------
// | Author: allen.qiang
// +----------------------------------------------------------------------

/**
 * EAI调用函数
 * @package  core
 * @author   allen.qiang
 */



/**
 * 生成eai类
 * @param $action
 * @return mixed
 */
function eai( $action ) {

    quanli_include(G_CONFIG_ROOT . 'config.eai.php');

    switch ($action) {

        case 'wechat':
            $eai_class = G_EAI_WECHAT;
            break;

        case 'crm':
            $eai_class = G_EAI_CRM;
            break;

        default:
            return null;
            break;

    }

    quanli_include('module/eai/' . $eai_class . '.eai.php');

    $eai_class .= 'Eai';

    return new $eai_class;

}

/**
 * 生成crm的eai类
 * @return mixed
 */
function eai_crm() {

    return eai('crm');

}